#!/usr/bin/python
def sieve(n):
	numbers = range(0,n)
	for prime in numbers:
		if prime < 2:
			continue
		elif prime > n ** 0.5: ### do not go over sqrt of n
			break
		for i in range(prime ** 2, n , prime):
			numbers[i] = 0
	return [x for x in numbers if x > 1]

l = sieve(2000000)
print sum(l)
